package com.wxy.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.wxy.domain.MyExceptionHandle;
import com.wxy.domain.user;
import com.wxy.service.userservice;

@Controller
public class usercontroller {
	@Autowired
	private userservice userservice;
	@RequestMapping("test")
	@ResponseBody
	public user test1() {
		return userservice.findById(1);
	}
	@RequestMapping("test2")
	@ResponseBody
	public void test2() {
		userservice.update();
	}
	@RequestMapping("test3")
	public String test3() {
		return "hello";
	}
	@RequestMapping("test4")
	@ResponseBody
	public int test4() {
//		int n=0;
//		if(n==0)
//			throw new MyExceptionHandle("n==0,滚蛋...");
		return 1/0;
	}
}
